<?php
namespace app\index\controller;
use app\index\controller\Base;

class Article extends Base{
	public function index(){
		$id=input('article_id');
		db('article')->where('id','eq',$id)->setInc('click');
		$cateid=db('article')->where('id',$id)->field('cateid')->find();
		$article=db('article')->alias('a')->join('cate b','a.cateid=b.id')->field('a.id,a.title,a.author,a.desc,a.keywords,a.content,a.pic,a.click,a.state,a.time,a.cateid,b.catename')->find($id);
		$stateArticle=db('article')->where(array('cateid'=>$cateid['cateid'],'state'=>'1'))->limit(8)->select();
		$this->assign('article',$article);
		$this->assign('stateArticle',$stateArticle);
		// var_dump($hotClick);exit();
		return $this->fetch('article');
	}
}

?>